<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta charset="utf-8"/>
<title>SetReturnUrl Filter
    - yiiext</title>
<style type="text/css">
    /* Meyer's reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-size: 100%;
    vertical-align: baseline;
    background: transparent;
}

body {
    line-height: 1;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

    /* remember to define focus styles! */
:focus {
    outline: 0;
}

    /* remember to highlight inserts somehow! */
ins {
    text-decoration: none;
}

del {
    text-decoration: line-through;
}

    /* tables still need 'cellspacing="0"' in the markup */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

    /*
    yiiext CSS
    Alexander Makarov, sam@rmcreative.ru
    */
body {
    font: normal 10pt Arial, Helvetica, sans-serif;
    background: #fff;
    color: #555;
    text-align: center;
}

a, a:visited {
    color: #306495;
    text-decoration: none;
}

a:hover {
    color: #73471b;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    font-family: Calibri, Helvetica, Arial, sans-serif;
}

h1 {
    font-size: 1.6em;
    margin: 1em 0 .5em;
}

h2 {
    font-size: 1.5em;
    margin: 1.07em 0 .535em;
}

h3 {
    font-size: 1.4em;
    margin: 1.14em 0 .57em;
}

h4 {
    font-size: 1.3em;
    margin: 1.23em 0 .615em;
}

h5 {
    font-size: 1.2em;
    margin: 1.33em 0 .67em;
}

h6 {
    font-size: 1.1em;
    margin: 1.6em 0 .8em;
}

::selection {
    background: #d3dfee;
    color: #000;
}

::-moz-selection {
    background: #d3dfee;
    color: #000;
}

acronym, abbr {
    cursor: help;
}

label {
    cursor: pointer;
}

hr {
    height: 1px;
    color: #ccc;
    background-color: #ccc;
    border: none;
}

#content {
    width: 980px;
    margin: 0 auto;
    text-align: left;

    background: #fff;
}

    /* guide content */
div.image {
    -moz-border-radius: 7px;
    -webkit-border-radius: 7px;
    -khtml-border-radius: 7px;
    border-radius: 7px;
    margin: 10px 0;
    border: 3px solid #eee;
    text-align: center;
}

div.image > p {
    background: #eee;
    margin: 0;
    font-weight: bold;
    display: block;
}

#content ul {
    list-style: disc inside;
}

#content ol {
    list-style: decimal inside;
}

#content li {
    line-height: 160%;
}

#content ul li li {
    list-style-type: circle;
}

#content ul, #content ol {
    margin: 0 0 1em 2em;
}

#content ul p, #content ol p {
    display: inline;
}

#content p {
    line-height: 160%;
    margin-bottom: 1em;
}

span.type {
    float: left;
    font-size: 1em;
    padding-right: 0.5em;
    font-weight: bold;
}

    /* code */
pre {
    display: block;
    padding: 1em;
    background: #fcfcfc;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-family: Consolas, "Courier New", Courier, mono;
    margin: 1em 0;
    font-size: 10pt;
    line-height: 130%;
}

code {
    border-bottom: 1px dotted #ccc;
    font-weight: bold;
    color: #666;
}

    /* --- code highlighting --- */

    /* html-code */
.html-hl-brackets,
.html-hl-reserved {
    color: #0000e6;
}

.html-hl-var,
.html-hl-code,
.html-hl-quotes,
.html-hl-string {
    color: #009933;
}

    /* php-code */
.php-hl-inlinetags {
    font-weight: bold;
}

.php-hl-comment {
    color: #777;
}

.php-hl-quotes,
.php-hl-string {
    color: #009933;
}

.php-hl-var {
    color: #6d3206;
}

.php-hl-reserved {
    color: #00e;
}

    /* css-code */
.css-hl-identifier {
    color: #007c00;
    font-weight: bold;
}

.css-hl-reserved {
    color: #0000e6;
}

    /* css-sql */
.sql-hl-reserved {
    color: #0000e6;
}

.sql-hl-identifier {
    color: #007c00;
}

.sql-hl-var {
    color: #0000e6;
}

.sql-hl-quotes, .sql-hl-string {
    color: #007c00;
}
</style>
</head>
<body>
<div id="content">
    <h1>SetReturnUrl Filter</h1>

    <p>Keeps current URL in session for all or specified controller actions so we can
        return to it if needed.</p>

    <h2>Installing and configuring</h2>

    <p>Unpack into your application <code>extensions</code> directory.</p>

    <p>Configure application (<code>config/main.php</code>):</p>

    <div class="hl-code">
        <div class="php-hl-main"><pre><span class="php-hl-reserved">return</span> <span
                class="php-hl-reserved">array</span><span class="php-hl-brackets">(</span>
    <span class="php-hl-quotes">'</span><span class="php-hl-string">import</span><span
                    class="php-hl-quotes">'</span><span class="php-hl-code">=&gt;</span><span class="php-hl-reserved">array</span><span
                    class="php-hl-brackets">(</span>
        <span class="php-hl-comment">//</span><span class="php-hl-comment"> …</span>
        <span class="php-hl-quotes">'</span><span class="php-hl-string">ext.yiiext.filters.setReturnUrl.ESetReturnUrlFilter</span><span
                    class="php-hl-quotes">'</span><span class="php-hl-code">,
    </span><span class="php-hl-brackets">)</span><span class="php-hl-code">,
    </span><span class="php-hl-comment">//</span><span class="php-hl-comment"> …</span>
<span class="php-hl-brackets">)</span><span class="php-hl-code">;</span></pre>
        </div>
    </div>

    <p>In controller implement <code>filters()</code> method:</p>

    <div class="hl-code">
        <div class="php-hl-main"><pre><span class="php-hl-reserved">function</span> <span class="php-hl-identifier">filters</span><span
                class="php-hl-brackets">(</span><span class="php-hl-brackets">)</span> <span
                class="php-hl-brackets">{</span>
    <span class="php-hl-reserved">return</span> <span class="php-hl-reserved">array</span><span class="php-hl-brackets">(</span>
        <span class="php-hl-quotes">'</span><span class="php-hl-string">accessControl</span><span class="php-hl-quotes">'</span><span
                    class="php-hl-code">,
        …
        </span><span class="php-hl-reserved">array</span><span class="php-hl-brackets">(</span>
            <span class="php-hl-quotes">'</span><span class="php-hl-string">ESetReturnUrlFilter</span><span
                    class="php-hl-quotes">'</span><span class="php-hl-code">,
            </span><span class="php-hl-comment">//</span><span class="php-hl-comment"> Use for spcified actions (index and view):</span>
            <span class="php-hl-comment">//</span><span
                    class="php-hl-comment"> 'ESetReturnUrlFilter + index, view',</span>
        <span class="php-hl-brackets">)</span><span class="php-hl-code">,
    </span><span class="php-hl-brackets">)</span><span class="php-hl-code">;
</span><span class="php-hl-brackets">}</span></pre>
        </div>
    </div>

    <h2>Usage</h2>

    <div class="hl-code">
        <div class="php-hl-main">
            <pre><span class="php-hl-var">$this</span><span class="php-hl-code">-&gt;</span><span
                    class="php-hl-identifier">redirect</span><span class="php-hl-brackets">(</span><span
                    class="php-hl-identifier">Yii</span><span class="php-hl-code">::</span><span
                    class="php-hl-identifier">app</span><span class="php-hl-brackets">(</span><span
                    class="php-hl-brackets">)</span><span class="php-hl-code">-&gt;</span><span
                    class="php-hl-identifier">user</span><span class="php-hl-code">-&gt;</span><span
                    class="php-hl-identifier">returnUrl</span><span class="php-hl-brackets">)</span><span
                    class="php-hl-code">;</span></pre>
        </div>
    </div>
    <hr/>
    <p style="text-align: right;">© 2009 — 2010, <a href="http://code.google.com/p/yiiext/">yiiext team</a>.</p>
</div>
</body>
</html>
